package random.fox.p2p.model;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import random.fox.p2p.AppModule;
import random.fox.p2p.interactors.MessageInteractor;
import random.fox.p2p.presenter.IndexPresenter;
import random.fox.p2p.presenter.IndexPresenterImpl;
import random.fox.p2p.ui.IndexView;
import random.fox.p2p.view.IIndexView;

/**
 * 主界面module
 * Created by wq on 15/3/30.
 */
@Module(
        injects = {
                IndexView.class,
        },
        addsTo = AppModule.class
)
public class IndexModule {
    private IIndexView indexView;

    public IndexModule(IIndexView indexView) {
        this.indexView = indexView;
    }

    @Provides
    @Singleton
    public IIndexView provideIIndexView() {
        return indexView;
    }

    @Provides
    @Singleton
    public IndexPresenter provideIndexPresenter(IIndexView indexView, MessageInteractor interactor) {
        return new IndexPresenterImpl(indexView, interactor);
    }


}
